package com.syqc.comlib

import com.syqc.comlib.utils.CacheMMKV

/**
 *@author  hfjs
 *@time   2024/10/15 10:32
 *@desc
 */
object GuideControl {
    init {
        newVersion()
    }

    // 车辆详情长按复制弹窗
    var isBaseCar
        get() = CacheMMKV.decodeBooleanSave("isShowCarBase", true)
        set(value) = CacheMMKV.encodeSave("isShowCarBase", value)

    //是否极简监控弹窗
    var isSimpleMonitor
        get() = CacheMMKV.decodeBooleanSave("isSimpleMonitor", true)
        set(value) = CacheMMKV.encodeSave("isSimpleMonitor", value)

    //登录页是否展示过引导页
    var isShowGuide
        get() = CacheMMKV.decodeBooleanSave("isShowGuide", false)
        set(value) = CacheMMKV.encodeSave("isShowGuide", value)

    //是否展示历史轨迹日历引导图
    var isShowLinePopup
        get() = CacheMMKV.decodeBooleanSave("isShowLinePopup", true)
        set(value) = CacheMMKV.encodeSave("isShowLinePopup", value)
    //多车监控车辆图标痰喘
    var isShowMulti
        get() = CacheMMKV.decodeBooleanSave("isShowMulti", true)
        set(value) = CacheMMKV.encodeSave("isShowMulti", value)

    //是否更新完版本
    var isShowClear
        get() = CacheMMKV.decodeBooleanSave("isShowClear", true)
        set(value) = CacheMMKV.encodeSave("isShowClear", value)

    //是否更新完版本2
    var isShowClear2
        get() = CacheMMKV.decodeBooleanSave("isShowClear2", true)
        set(value) = CacheMMKV.encodeSave("isShowClear2", value)

    //每次发新版本都要替换一下  isShowClear和isShowClear2
    //是否是新版本
    private fun newVersion() {
        if (isShowClear) {
            isBaseCar = true
            isSimpleMonitor = true
            isShowGuide = false
            isShowLinePopup = true
            isShowClear = false
            isShowClear2 = true
        }
    }
}